import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import mutations from './mutations'
import actions from './actions'

// 1.安装插件
Vue.use(Vuex)

// 2.创建对象
const state = { // 创建基本状态
  islongin: false, // 登录状态为没登录
  user: { // 用户信息数据,目前只需要avatar和name,还是把username也加上吧
    id: '',
    name: '',
    avatar: '',
    token: ''
  }
}
const store = new Vuex.Store({
  state,
  getters,
  mutations,
  actions

})
export default store
